<?php 
declare (strict_types = 1);
namespace app\api\controller;
use app\common\controller\Api;
use think\Request;
class ScriptRole extends Api
{
    public function add()
    {
        $post = param();
        if(!isset($post['name']) || !isset($post['image']) || !isset($post['content'])){
            return msgerror('参数缺失');
        }
        $this->model->save($post);
        $id = $this->model->id;
        return datasuccess(['id'=>$id]);
    }
}